import axios from '@/utils/request'
/**
 * 获取用户频道列表
 * @returns
 */
export const getChannels = () => {
  return axios({
    method: 'GET',
    url: '/v1_0/user/channels'
  })
}
/**
 *获取所有频道列表
 * @returns
 */
export const getAllChannels = () => {
  return axios({
    method: 'GET',
    url: '/v1_0/channels'
  })
}
/**
 * 设置用户频道
 * @param {*} channels
 * @returns
 */
export function setUserChannel(channels) {
  return axios({
    method: 'PATCH',
    url: '/v1_0/user/channels',
    data: {
      channels
    }
  })
}
/**
 * 删除频道操作
 */
export function delUserChannel(target) {
  return axios({
    method: 'DELETE',
    url: `/v1_0/user/channels/${target}`
  })
}
